'''
Created on May 16, 2010

@author: william
'''

import os
import sys_state_deb

# This function uses the apt package manager for installing
# packages.
def install(package):
    output = sys_state_deb.command('apt-get install -fy '+ package)
    for line in output: # Prints the output of the command.
        print line

# This function uses apt to remove packages.
def remove(package):
    output = sys_state_deb.command('apt-get remove -fy '+ package)
    for line in output: # Prints the output of the command.
        print line

# Uses apt to update its sources and packages.
def upgrade():
    output = sys_state_deb.command('apt-get update && apt-get -fy upgrade')
    for line in output:
        print line

print upgrade()